
<title>商品统计</title>

<div class="layui-card layadmin-header">
    <div class="layui-breadcrumb" lay-filter="breadcrumb">
        <a lay-href="">主页</a>
        <a><cite>商品统计</cite></a>
    </div>
</div>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">


        <div class="layui-col-sm6 layui-col-md3">
            <div class="layui-card">
                <div class="layui-card-header">
                    今日新增
                    <span class="layui-badge layui-bg-blue layuiadmin-badge layui-hide">周</span>
                </div>
                <div class="layui-card-body layuiadmin-card-list">
                    <p class="layuiadmin-big-font"> {$today_goods}</p>
                    <p>
                        虚拟卡
                        <span class="layuiadmin-span-color">{$today_cards} </span>
                    </p>
                </div>
            </div>
        </div>    <div class="layui-col-sm6 layui-col-md3">
        <div class="layui-card">
            <div class="layui-card-header">
                累计
            </div>
            <div class="layui-card-body layuiadmin-card-list">
                <p class="layuiadmin-big-font"> {$all_goods} </p>
                <p>
                    虚拟卡
                    <span class="layuiadmin-span-color">{$all_cards} </span>
                </p>
            </div>
        </div>
    </div>



        <div class="layui-col-sm12">
            <div class="layui-card">
                <div class="layui-card-header">
                    商品统计
                    <div class="layui-btn-group layuiadmin-btn-group" style="display: none">
                        <button class="layui-btn layui-btn-primary layui-btn-xs">去年</button>
                        <button class="layui-btn layui-btn-primary layui-btn-xs">今年</button>
                    </div>
                </div>
                <div class="layui-card-body">
                    <div class="layui-row">
                        <div class="layui-col-sm12">
                            <div class="layui-carousel layadmin-carousel layadmin-dataview" data-anim="fade"
                                 lay-filter="LAY-index-pagetwo">
                                <div carousel-item id="LAY-index-pagetwo">
                                    <div><i class="layui-icon layui-icon-loading1 layadmin-loading"></i></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>


    </div>
</div>

<script>

    layui.define(function (exports) {
        var admin = layui.admin;

        //区块轮播切换
        layui.use(['admin', 'carousel'], function () {
            var $ = layui.$
                , admin = layui.admin
                , carousel = layui.carousel
                , element = layui.element
                , device = layui.device();

            //轮播切换
            $('.layadmin-carousel').each(function () {
                var othis = $(this);
                carousel.render({
                    elem: this
                    , width: '100%'
                    , arrow: 'none'
                    , interval: othis.data('interval')
                    , autoplay: othis.data('autoplay') === true
                    , trigger: (device.ios || device.android) ? 'click' : 'hover'
                    , anim: othis.data('anim')
                });
            });

            element.render('progress');

        });

        //访问量
        layui.use(['carousel', 'echarts'], function () {
            var $ = layui.$
                , carousel = layui.carousel
                , echarts = layui.echarts;

            var echartsApp = []
                , elemDataView = $('#LAY-index-pagetwo').children('div')
            ;
            //没找到DOM，终止执行
            if (elemDataView[0]) {

                $.ajax({
                    type: 'get',
                    url: "{:url('store/admin.Statistics/good?data=1')}",
                    dataType: 'json',
                    timeout: 3000,
                    success: function (data) {
                        options = [data];
                        echartsApp[0] = echarts.init(elemDataView[0], layui.echartsTheme);
                        echartsApp[0].setOption(options[0]);
                        window.onresize = echartsApp[0].resize;
                    },
                    error: function (xhr, type) {
                        layer.msg('异常');
                    }
                })

            }
            ;

        });


    });


</script>




